package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.dubbo.api.db.QuestionnaireApi;
import com.tanhua.dubbo.api.mapper.QuestionnaireMapper;
import com.tanhua.model.db.Questionnaire;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class QuestionnaireApiImpl implements QuestionnaireApi {
    @Autowired
    private QuestionnaireMapper questionnaireMapper;

    @Override
    public List<Questionnaire> findAll() {
        QueryWrapper<Questionnaire> queryWrapper = new QueryWrapper<>();
        queryWrapper.orderByAsc("id");
        return questionnaireMapper.selectList(queryWrapper);
    }
}
